package org.example.gsonformattool;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @Classname GsonFormatPlusFastjsonVirgoTest
 * @Description  使用GsonFormatPlus生成实体类
 * @Date 2021/2/4 10:13 上午
 * @Created by xiangjd
 */
@NoArgsConstructor
@Data
public class GsonFormatPlusFastjsonVirgoTest {
    /**
     * name : 河北省
     * value : [11,12,13]
     * itemStyle : {"normal":{"color":"#0099FF"}}
     */

    @JSONField(name = "name")
    private String name;
    @JSONField(name = "value")
    private List<Integer> value;
    @JSONField(name = "itemStyle")
    private ItemStyleDTO itemStyle;

    @NoArgsConstructor
    @Data
    public static class ItemStyleDTO {
        /**
         * normal : {"color":"#0099FF"}
         */

        @JSONField(name = "normal")
        private NormalDTO normal;

        @NoArgsConstructor
        @Data
        public static class NormalDTO {
            /**
             * color : #0099FF
             */

            @JSONField(name = "color")
            private String color;
        }
    }
}
